{
  function _base() {
    class Person {
      name: string
      age: number
      constructor(name: string, age: number) {
        this.name = name
        this.age = age
      }
      eat() {
        console.log('eat somethong')
      }
    }

    const person = new Person('xiaohong', 18)
    console.log(person)
  }

  function _extends() {
    class Person {
      eat() {
        console.log('吃饭')
      }
    }

    class Teacher extends Person {
      teach() {
        console.log('教书');
      }
    }

    const teacher = new Teacher()
    teacher.eat()
    teacher.teach()
  }

  function _public() {
    class Person {
      public name = "person1"
    }
    const person = new Person()
    console.log(person.name)
  }

  function _private() {
    class Person {
      private name = 'person'
    }

    class Teacher extends Person {
      teach() {
        // console.log(this.name)  //报错
      }
    }

    const person = new Person()
    // console.log(person.name) //报错
  }

  function _getset() {
    class Person {
      _name = 'person'
      get name() {
        return this._name
      }
      set name(val) {
        this.name = val
      }
    }

    const person = new Person()
    person.name = 'xiaohong'
    console.log(person.name)  //小红
  }

  function _protected() {
    class Person {
      protected name = 'person'
    }

    class Teacher extends Person {
      getName() {
        return this.name
      }
    }

    const person = new Person()
    // console.log(person.name) //报错
  }
  function _readonly() {
    class Person {
      readonly name = 'person'

      setName() {
        console.log(this.name) //person
        // this.name = 'person1' //报错
      }
    }

    const person = new Person()
    console.log(person.name); //person
    // person.name = 'person1'//报错

  }

  function _static() {
    class Person {
      static job = 'person'

      consoleJob() {
        // console.log(this.job) //报错
        console.log(Person.job) //person
      }
    }

    const person = new Person()
    // console.log(person.job) //报错
    console.log(Person.job) //person
    person.consoleJob()
  }




  // _base()
  //_extends()
  // _public()
  // _getset()
  // _protected()
  // _static()
}